extends Node2D

@onready var label: Label = $CanvasLayer/Control/开场演出文本/Label
@onready var label_2: Label = $CanvasLayer/Control/开场演出文本/Label2
@onready var label_3: Label = $CanvasLayer/Control/开场演出文本/Label3
@onready var label_4: Label = $CanvasLayer/Control/开场演出文本/Label4
@onready var label_5: Label = $CanvasLayer/Control/开场演出文本/Label5
@onready var label_6: Label = $CanvasLayer/Control/开场演出文本/Label6
@onready var control: Control = $CanvasLayer/Control

signal perform_over

var home = preload("res://scenes/Home 01.tscn")

#开场文本演出
func _ready() -> void:
	change_visible_ration_to_zero()
	typing_words()


#隐藏文本
func change_visible_ration_to_zero():
	label.visible_ratio = 0
	label_2.visible_ratio = 0
	label_3.visible_ratio = 0
	label_4.visible_ratio = 0
	label_5.visible_ratio = 0
	label_6.visible_ratio = 0


#打出文本
func typing_words():
	var tween = create_tween()
	tween.tween_property(label, "visible_ratio" , 1.0, 3.5)
	tween.tween_property(label_2, "visible_ratio" , 1.0, 3.0)
	tween.tween_property(label_3, "visible_ratio" , 1.0, 3.0)
	tween.tween_property(label_4, "visible_ratio" , 1.0, 3.0)
	tween.tween_property(label_5, "visible_ratio" , 1.0, 3.0)
	tween.tween_property(label_6, "visible_ratio" , 1.0, 3.0)
	tween.tween_property(control, "modulate:a", 0.0, 3.0)
	await tween.finished
	queue_free()
